#ifndef _HUD_SCREEN_H_
# define _HUD_SCREEN_H_

# include "Utils\\IScreen.h"
# include "Utils\\IArgs.h"
# include "Utils\\Surface.h"
# include "Elements\\Image.h"
# include "Elements\\PushButton.h"
# include "Elements\\CheckBox.h"
# include "Utils\\ScreenManager.h"
# include "Bloc.h"
# include "BlocManager.h"
# include <vector>

struct HUDArgs : public SDL::UTILS::ScreenArgs
{
public:
	SDL::UTILS::Surface& LoadedBackground;
	std::string& BackgroundFile;
	std::wstring& MapFile;
	Bloc*& CurrentBloc;
	BlocManager& Blocs;
	bool& ShowGrid;

public:
	HUDArgs(SDL_Surface* _screen, SDL_Event* _event,
			SDL::UTILS::Surface& _loadedBackground,
			std::string& _backgroundFile, std::wstring& _mapFile,
			Bloc*& _currentBloc,
			BlocManager& _blocs, bool& _showGrid);
	virtual ~HUDArgs();
};

class HUDScreen : public SDL::UTILS::IScreen
{
private:
	SDL::UTILS::Surface m_background;
	SDL::ELEMENTS::Image m_cursor;
	SDL::ELEMENTS::Image m_tiles;
	SDL::ELEMENTS::PushButton m_pbNew;
	SDL::ELEMENTS::PushButton m_pbReset;
	SDL::ELEMENTS::PushButton m_pbSave;
	SDL::ELEMENTS::PushButton m_pbSaveAs;
	SDL::ELEMENTS::PushButton m_pbLoad;
	SDL::ELEMENTS::PushButton m_pbBackground;
	SDL::ELEMENTS::CheckBox m_cbShowGrid;

public:
	HUDScreen();
	virtual ~HUDScreen();
	
	static void SetTilesPositions(BlocManager& _blocs);
	virtual void Draw(SDL::UTILS::IArgs* _datas);
	virtual void Exec(SDL::UTILS::IArgs* _datas);
	static bool Manage(SDL::UTILS::ScreenManager::Element* _caller,
					   SDL::UTILS::IArgs* _args);

private:
	void InitButtons();
	void MoveCursorInTiles(int _blocNumber, HUDArgs* _args);
	
	void On_pbNew_Clicked(SDL::UTILS::IArgs* _datas);
	void On_pbReset_Clicked(SDL::UTILS::IArgs* _datas);
	void On_pbSaveAs_Clicked(SDL::UTILS::IArgs* _datas);
	void On_pbSave_Clicked(SDL::UTILS::IArgs* _datas);
	void On_pbLoad_Clicked(SDL::UTILS::IArgs* _datas);
	void On_pbBackground_Clicked(SDL::UTILS::IArgs* _datas);
};

#endif // _HUD_SCREEN_H_
